<!--  @author:ymy  -->
<template>
  <div class="boss-live">
    <pro-title :title="title" />
    <div class="live-content">
      <div :class="{ 'live-item': true, 'live-little': index != 0 }" v-for="(item, index) in live" :key="item.id">
        <div class="live-item-header">
          <img class="headShot" :src="'https://ss.lanqb.com/' + item.profile.avatar" alt="" />
          <span>{{ item.profile.nickname }}</span>
        </div>
        <div class="live-item-title">
          <a :href="'https://m.lanqb.com/daniu-lecture/' + item.id">
            <strong>{{ item.title }}</strong>
          </a>
        </div>
        <a :href="'https://m.lanqb.com/daniu-lecture/' + item.id" class="live-img">
          <img :src="'https://ss.lanqb.com/' + item.posters.app" alt="" v-if="index != 0" />
          <img :src="'https://ss.lanqb.com/' + item.posters.banner" alt="" v-else />
          <span class="period">第{{ item.periods }}期</span>
        </a>
        <div class="live-item-footer">
          <span>时间：{{ item.begin_at.slice(5, item.begin_at.length) }}</span>
          <span v-if="index == 0">{{ item.statistic.purchases }}人感兴趣</span>
          <span v-else><van-icon name="like-o" />{{ item.statistic.purchases }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import ProTitle from '../ProTitle';
export default {
  name: 'Live',
  data() {
    return {
      title: '大咖直播'
    };
  },
  components: {
    ProTitle
  },
  props: ['live']
};
</script>
<style lang="less" scoped>
.boss-live {
  margin-top: 0.1rem;
  height: 5.09rem;
  background-color: white;
  > .live-title {
    height: 0.34rem;
    line-height: 0.34rem;
    padding: 0px 0.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 0.01rem solid #e6e6e6;
    > h3 {
      font-size: 0.14rem;
      font-weight: normal;
    }
    > span {
      font-size: 0.12rem;
      color: #a4a4a4;
    }
  }
  > .live-content {
    width: 100vw;
    height: 4.44rem;
    padding: 15px;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    > .live-item {
      width: 3.25rem;
      height: 1.8rem;
      padding: 0.08rem 0.1rem 0.075rem;
      margin-bottom: 0.1rem;
      box-shadow: 0px 0px 0.1rem 0px #a4a4a4;
      border-radius: 0.1rem;
      > .live-item-header {
        display: flex;
        align-items: center;
        margin-bottom: 0.06rem;
        position: relative;
        > img {
          width: 0.17rem;
          height: 0.17rem;
          border-radius: 50%;
        }

        > span {
          margin-left: 0.06rem;
          font-size: 0.12rem;
          line-height: 0.17rem;
          height: 0.17rem;
        }
      }
      > .live-item-title {
        display: block;
        height: 0.175rem;
        line-height: 0.175rem;
        margin-bottom: 0.06rem;
        a {
          font-size: 0.12rem;
          color: black;
        }
      }
      > .live-img {
        position: relative;
        img {
          width: 3.25rem;
          height: 1.1rem;
        }
        > .period {
          position: absolute;
          top: -0.88rem;
          right: 0;
          z-index: 1;
          height: 0.18rem;
          min-width: 0.525rem;
          padding-right: 0.04rem;
          padding-left: 0.04rem;
          color: #fff;
          font-size: 0.12rem;
          line-height: 0.18rem;
          background-color: rgba(0, 0, 0, 0.4);
          white-space: nowrap;
          text-align: center;
          -webkit-box-sizing: border-box;
          box-sizing: border-box;
          border-radius: 0.05rem;
        }
      }
      .live-img:before {
        position: absolute;
        top: -0.91rem;
        left: 0;
        z-index: 1;
        padding-right: 0.0675rem;
        padding-left: 0.0675rem;
        font-size: 0.12rem;
        width: 0.48rem;
        height: 0.18rem;
        line-height: 0.18rem;
        color: #fff;
        background-color: #ff3f72;
        content: '\5373\5C06\76F4\64AD';
        border-radius: 0 0 0.053333rem 0;
      }
      > .live-item-footer {
        display: flex;
        justify-content: space-between;
        font-size: 0.12rem;
        color: #a4a4a4;
      }
    }
    > .live-little {
      width: 1.475rem;
      height: 2.13rem;
      > .live-img {
        img {
          width: 1.475rem;
          height: 1.105rem;
        }
      }
      .live-img:before {
        display: none;
      }
      > .live-item-footer {
        flex-wrap: wrap;
      }
    }
  }
}
</style>
